package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MyCommodityMapper;
import com.ruoyi.system.domain.MyCommodity;
import com.ruoyi.system.service.IMyCommodityService;

import javax.annotation.Resource;

/**
 * 商品信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-13
 */
@Service
public class MyCommodityServiceImpl implements IMyCommodityService
{
    @Resource
    private MyCommodityMapper myCommodityMapper;

    /**
     * 查询商品信息
     *
     * @param id 商品信息主键
     * @return 商品信息
     */
    @Override
    public MyCommodity selectMyCommodityById(Long id)
    {
        return myCommodityMapper.selectMyCommodityById(id);
    }

    /**
     * 查询商品信息列表
     *
     * @param myCommodity 商品信息
     * @return 商品信息
     */
    @Override
    public List<MyCommodity> selectMyCommodityList(MyCommodity myCommodity)
    {
        return myCommodityMapper.selectMyCommodityList(myCommodity);
    }

    /**
     * 新增商品信息
     *
     * @param myCommodity 商品信息
     * @return 结果
     */
    @Override
    public int insertMyCommodity(MyCommodity myCommodity)
    {
        return myCommodityMapper.insertMyCommodity(myCommodity);
    }

    /**
     * 修改商品信息
     *
     * @param myCommodity 商品信息
     * @return 结果
     */
    @Override
    public int updateMyCommodity(MyCommodity myCommodity)
    {
        return myCommodityMapper.updateMyCommodity(myCommodity);
    }

    /**
     * 批量删除商品信息
     *
     * @param ids 需要删除的商品信息主键
     * @return 结果
     */
    @Override
    public int deleteMyCommodityByIds(Long[] ids)
    {
        return myCommodityMapper.deleteMyCommodityByIds(ids);
    }

    /**
     * 删除商品信息信息
     *
     * @param id 商品信息主键
     * @return 结果
     */
    @Override
    public int deleteMyCommodityById(Long id)
    {
        return myCommodityMapper.deleteMyCommodityById(id);
    }
}
